package com.example.demo.Thread;

/**
 * @author Administrator
 */
public class RunnableTest implements Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName() + "跑了" + i);
        }

    }

    public static void main(String[] args) {
        RunnableTest runnableTest = new RunnableTest();

        for (int i = 0; i < 10; i++) {
            new Thread(runnableTest, "测试" + i).start();
        }

    }
}
